<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .as a{
            float: left;
            display: block;
            height: 100px;
            width: 100px;
            background-color: aquamarine;
            margin-right: 10px;
            border-radius: 50%;
            text-decoration: none;
            text-align: center;
            line-height: 100px;
        }
        /*选中a标签中有id属性的*/
        .as a[id]{
            background-color: red;
        }
        /*选中a标签中id等于具体值的*/
        .as a[id = id3]{
            background-color: darkorchid;
        }
        /*选中a标签中class包含link的*/
        .as a[class *= link]{
            background-color: coral;
        }
        /*选中a标签中href值以../开头的*/
        .as a[href ^= "../"]{
            background-color: yellow;
        }
        /*选中a标签中href值以pdf结束的*/
        .as a[href $= "pdf"]{
            background-color: pink;
        }
    </style>
</head>

<body>
<p class="as">
    <a href="http://localhost" id="">1</a>
    <a href="http://localhost" class="link 2">2</a>
    <a href="" id="id3">3</a>
    <a href="../css四种导入方式/123.jpg">4</a>
    <a href="../css四种导入方式/123.pdf">5</a>
</p>
</body>
</html>